﻿using Domain.Entities.Tenants;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;

namespace Domain.Entities.Organizations
{
    /// <summary>
    /// 组织机构
    /// </summary>
    [Description("组织机构")]
    public class Organization : BaseAuditableSoftDeleteEntity, IAuditTrial, ITenant
    {
        /// <summary>
        /// 组织机构名称
        /// </summary>
        [Description("组织机构名称")]
        public virtual string? OrganizationName { get; set; }

        /// <summary>
        /// 手机号码
        /// </summary>
        [Description("手机号码")]
        public virtual string? PhoneNumber { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        [Description("邮箱")]
        public virtual string? Email { get; set; }


        /// <summary>
        /// 排序
        /// </summary>
        [Description("排序")]
        public virtual int Sort { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        [Description("描述")]
        public virtual string? Description { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        [Description("状态")]
        public virtual bool? IsActive { get; set; }

        /// <summary>
        /// 上级节点
        /// </summary>
        [Description("上级节点")]
        public virtual long? ParentId { get; set; } = null;

        /// <summary>
        /// 上级节点
        /// </summary>
        [Description("上级节点")]
        [ForeignKey("ParentId")]
        public virtual Organization? Parent { get; set; } = null;
        public virtual Tenant? Tenant { get; set; }
        public virtual string? TenantId { get; set; }
    }
}
